/*
 * @Descripttion: 
 * @version: 1.0
 * @Author: LiYansheng
 * @Date: 2022-04-22 13:16:52
 * @LastEditors: CoderXZ
 * @LastEditTime: 2022-05-01 22:57:34
 */
import request from '@/utils/request'

// 查询
export function search(form){
    return request({
        url:'/major',
        method:'post',
        data:{
            schoolName:form.schoolName,
            no:form.no,
            name:form.name,
            collegeName:form.collegeName,
            pageIndex:form.pageIndex,
            pageSize:form.pageSize
        }
    })
}

// 添加
export function add(form){
    return request({
        url:'/major/add',
        method:'post',
        data:{
            no:form.no,
            name:form.name,
            schoolId:form.schoolName,
            collegeId:form.collegeName,
            status:form.status
        }
    })
}

// 删除
export function del(id){
    return request({
        url:'/major/delete',
        method:'post',
        data:{
            id:id
        }
    })
}

// 修改
export function update(form){
    return request({
        url:'/major/update',
        method:'post',
        data:{
            id:form.id,
            no:form.no,
            name:form.name,
            collegeId:form.collegeName,
            status:form.status
        }
    })
}

// 批量删除
export function delList(ids){
    return request({
        url:'/major/delList',
        method:'post',
        data:{
            ids:ids
        }
    })
}

// 获取可用学校名及id
export function searchSchool(){
    return request({
        url:'/school',
        method:'get',
    })
}

// 找指定学校下的学院
export function searchCollege(id){
    return request({
        url:'/college/find',
        method:'post',
        data:{
            id:id
        }
    })
}

// 找指定学院下的专业
export function searchMajor(id){
    return request({
        url:'/major/find',
        method:'post',
        data:{
            id:id
        }
    })
}


// 找指定专业下的班级
export function searchClass(id){
    return request({
        url:'/classes/find',
        method:'post',
        data:{
            id:id   
        }
    })
}
